package org.example.crm.business.controller;

import org.example.crm.business.entity.Business;
import org.example.crm.business.service.IBusinessService;
import org.example.crm.clue.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 商机表 前端控制器
 * </p>
 *
 * @author baomidou
 * @since 2023-07-05
 */
@RestController
@RequestMapping("/business")
@CrossOrigin
public class BusinessController {
    @Autowired
    private IBusinessService businessService;

    @GetMapping("/{id}")
    public Result<Business> get(@PathVariable Long id) {
        return Result.ok(businessService.getById(id));
    }

    public Result<Business> getaal(){
        return Result.error("sdfsfs");
    }

}
